﻿using AMM.Model;
using AMM.Model.Store;

namespace AMM.UserControls {
    public partial class MaterialInventorySearchControl : BaseSearchControl {

        public override BaseSearchModel GetSearchModel() {
            MaterialInventorySearchModel searchResult = new MaterialInventorySearchModel();
            searchResult.MaterialCode = this.tbMaterialCode.Text;
            searchResult.StoreBasisCode = this.tbStoreBasis.Text;
            searchResult.MaterialInStoreDateStart = this.GetDateTimePickerValue(this.dtpCreateStart);
            searchResult.MaterialInStoreDateEnd = this.GetDateTimePickerValue(this.dtpCreateEnd);

            return searchResult;
        }

        public override void ResetSearchModel() {
            this.tbMaterialCode.Clear();
            this.tbStoreBasis.Clear();
            this.dtpCreateStart.Checked = false;
            this.dtpCreateEnd.Checked = false;
        }

        public MaterialInventorySearchControl() {
            InitializeComponent();
        }
    }
}
